package com.newtouch.avmarketing.mgr.modules.avmarkrting.repo;

import com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.DoubleAuditing;
import com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.dto.DoubleAuditingDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Transactional
public interface DoubleAuditingDtoRepo extends JpaRepository<DoubleAuditing,Long> {

    /**
     * 双录审核信息查询   表名==实体类对象的名称 DoubleAuditing
     * @param policyCode
     * @return
     */
    @Query(value = "select new com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.dto.DoubleAuditingDto" +
            "(a.id,a.policyName,a.policyAge,a.policyCode,a.videoTime,a.videoSize,a.videoPath,a.uploadTime) " +
            "from DoubleAuditing a where a.policyCode = ?1 ")
    public DoubleAuditingDto findDoubleAuditingDto(String policyCode);
}

